package com.qzsoft.zhjd.materiel.modules.materieldatainput.dto;

import java.math.BigDecimal;
import java.util.Date;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

import com.fasterxml.jackson.annotation.JsonFormat;

import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;

/**
 * @ClassName MaterielDataInputDto
 * @Description 磅单补录对象
 * @author linhuawei
 * @since 2022-04-11
 */
@Data
public class MaterielDataInputDto {

    /**
     * 磅单编号
     */
    @NotEmpty(message = "磅单编号不可为空")
    @Length(max = 36, message = "磅单编号不可超过{max}")
    @Excel(name = "磅单编号", width = 36)
    private String weightCode;

    /**
     * 车牌号
     */
    @NotEmpty(message = "车牌号不可为空")
    @Length(max = 10, message = "车牌号格式错误")
    @Excel(name = "车牌号", width = 16)
    private String carNumber;

    /**
     * 过磅类型：0=收料，1=发料
     */
    @NotEmpty(message = "磅单类型不可为空")
    @Excel(name = "磅单类型", width = 16)
    private String weightTypeLabel;
    
    /**
     * 过磅类型：0=收料，1=发料
     */
    private String weightType;

    /**
     * 数据类型（采购、销售等）
     */
    @NotEmpty(message = "收/发料类型不可为空")
    @Excel(name = "收/发料类型", width = 16)
    private String weightDataTypeLabel;

    /**
     * 数据类型（采购、销售等）
     */
    private String weightDataType;

    /**
     * 供应商名称
     */
    @Excel(name = "供应商", width = 32)
    private String supplierName;

    /**
     * 供应商主键
     */
    private String supplierId;

    /**
     * 用料项目/单位名称
     */
    @Excel(name = "用料项目/单位", width = 32)
    private String projectName;

    /**
     * 用料项目/单位主键
     */
    private String projectId;

    /**
     * 物料名称
     */
    @NotEmpty(message = "物料名称不可为空")
    @Excel(name = "物料名称", width = 20)
    private String materielItemName;

    /**
     * 物料规格
     */
    @Excel(name = "规格", width = 10)
    private String materielItemSpec;
    
    /**
     * 材料主键
     */
    private String materielItemId;

    /**
     * 毛重/t
     */
    @NotNull(message = "毛重不可为空")
    @Excel(name = "毛重", width = 10)
    private BigDecimal grossWeight;

    /**
     * 皮重/t
     */
    @NotNull(message = "皮重不可为空")
    @Excel(name = "皮重", width = 10)
    private BigDecimal tareWeight;

    /**
     * 净重/t
     */
    @NotNull(message = "净重不可为空")
    @Excel(name = "净重", width = 10)
    private BigDecimal netWeight;

    /**
     * 扣重占比
     */
    @Excel(name = "扣重占比", width = 10)
    private BigDecimal deductionRatio;

    /**
     * 扣重/t
     */
    @Excel(name = "扣重", width = 10)
    private BigDecimal deductionWeight;

    /**
     * 实际重量
     */
    @Excel(name = "实际重量", width = 10)
    private BigDecimal weight;

    /**
     * 实际数量
     */
    @Excel(name = "实际数量", width = 10)
    private BigDecimal quantity;

    /**
     * 运单编号
     */
    @Excel(name = "运单编号", width = 32)
    private String waybillCode;

    /**
     * 运单重量/t
     */
    @Excel(name = "运单重量", width = 10)
    private BigDecimal waybillWeight;

    /**
     * 运单数量
     */
    @Excel(name = "运单数量", width = 10)
    private BigDecimal waybillQuantity;

    /**
     * 偏差：0=正常，1=超负差，2=超正差
     */
    @Excel(name = "偏差", width = 10)
    private String deviationTypeLabel;

    /**
     * 偏差率
     */
    @Excel(name = "偏差率", width = 10)
    private BigDecimal deviationRatio;

    /**
     * 正差值
     */
    @Excel(name = "正差值", width = 10)
    private BigDecimal upperLimit;

    /**
     * 负差值
     */
    @Excel(name = "负差值", width = 10)
    private BigDecimal lowerLimit;

    /**
     * 进磅时间
     */
    @NotNull(message = "进场时间不可为空")
    @Excel(name = "进场时间", width = 20, importFormat = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    private Date entryTime;

    /**
     * 出磅时间
     */
    @NotNull(message = "出场时间不可为空")
    @Excel(name = "出场时间", width = 20, importFormat = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    private Date exitTime;

    /**
     * 操作员姓名
     */
    @NotEmpty(message = "过磅员不可为空")
    @Excel(name = "过磅员", width = 20)
    private String operatorName;
    
    /**
     * 操作员主键
     */
    private String operatorId;

    /**
     * 备注
     */
    @Length(max = 200, message = "备注不可超过{max}")
    @Excel(name = "备注", width = 40)
    private String remark;

    /**
     * 是否废弃：0=否，1=是
     */
    @Excel(name = "是否废弃", width = 10)
    private String disableLabel;

    /**
     * 是否废弃：0=否，1=是
     */
    private Integer disable;
    
    /**
     * 废弃原因
     */
    @Length(max = 200, message = "废弃原因不可超过{max}")
    @Excel(name = "废弃原因", width = 40)
    private String disableReason;

    /**
     * 导入结果
     */
    private boolean success;

    /**
     * 错误信息
     */
    private String errorMesg;

}
